#include <functional>
#include <set>
#include <map>
#include <iostream>

using namespace std;

class FunctionPrint
{
	double _yMin = 0;
	double _yMax = 0;
	double _xDelta = 0;
public:
	size_t _height = 40;
	size_t _weight = 40;
	double _xMin = 0;
	double _xMax = 10;
	std::function<double(double)> _func;
	std::map<double, std::set<double>, std::greater<>> _data;

	bool gen()
	{
		_xDelta = (_xMax - _xMin) / _weight;
		for (double x = _xMin; x <= _xMax; x += _xDelta)
		{
			double y = _func(x);
			if (_yMin > y) _yMin = y;
			if (_yMax < y) _yMax = y;

			_data[y].insert(x);
		}
	}

	std::ostream& show(std::ostream& os) const
	{
		std::map<size_t, std::set<size_t>, std::greater<>> buf;
		for (auto& xSet : _data)
		{
			for (auto& x : xSet.second)
			{

			}
		}
	}
};

int main()
{

}